IF OBJECT_ID('dbo.GetDeliverableStatusesSpecial') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.GetDeliverableStatusesSpecial
    IF OBJECT_ID('dbo.GetDeliverableStatusesSpecial') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.GetDeliverableStatusesSpecial >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.GetDeliverableStatusesSpecial >>>'
END  
GO
-- =======================================================================
-- Procedure Name: dbo.GetDeliverableStatusesSpecial
--
-- Author:      Kevin Cashman, Parallax Consulting LLC
--
-- Create date: 03/12/09
--
-- Description: Returns list of Deliverable Statuses for Subcontract Reports
--
-- Parameters:  None
--              
-- Returns:     INT, 0=Success, -1=Error
--
-- SampleCall:
-- EXECUTE dbo.GetDeliverableStatuses()
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 03/12/09    RM		 Created based on the GetDeliverableTypes stored
--
-- =======================================================================

CREATE PROCEDURE [dbo].[GetDeliverableStatusesSpecial]
AS
BEGIN
     /*  Returned Fields for Dropdown
     --------------------------------
     DELSTAT             VARCHAR             
     DELSTATID           VARCHAR
     */

     -- Initial Settings
     SET NOCOUNT ON
     
     -- Declare Local Variables
     DECLARE   @Error            INT,
               @RowCount         INT

     -- Result Query    
     SELECT 'ALL'   AS DELSTAT,
               0    AS DELSTATID,
            'All' AS DELSTATDESC
     UNION
     SELECT 'Sub In - Partially Executed',
               6,
            'Sub In - Partially Executed'
     UNION  
     SELECT 'Sub In - Fully Executed',
               7,
            'Sub In - Fully Executed'
     UNION
     SELECT 'Sub In - Unexecuted Agreement Received',
               11,
            'Sub In - Unexecuted Agreement Received'
     UNION
	SELECT 'Sub Out - Partially Executed',
               17,
            'Sub Out - Partially Executed'
     UNION
	SELECT 'Sub Out - Fully Executed',
               18,
            'Sub Out - Fully Executed'
    ORDER BY DELSTATID              

     SELECT @Error=@@ERROR,@RowCount=@@ROWCOUNT
     IF @Error!=0
          RETURN -1

     -- Return Success
     RETURN 0
     
END
GO

IF OBJECT_ID('dbo.GetDeliverableStatuses') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.GetDeliverableStatusesSpecial >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.GetDeliverableStatusesSpecial >>>'
GO

GRANT EXECUTE ON dbo.GetDeliverableStatuses TO InsightReport,Insight
GO

